using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.IO;
using System.Xml.Serialization;


namespace AtlantisRevenge.GamePlay.Estados
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class Recordes : EstadoBase
    {
        Botao irparamenu;
        Color recordeCor = Color.Navy;
        SpriteFont arial;
        SpriteFont arial_large;
        Vector2 posicaoScore;

        HiscoreData HighScore;

        public Recordes(ContentManager Content, GameWindow Window)
            : base(Content, Window)
        {
            HighScore = new HiscoreData();
            
            fundo = Content.Load<Texture2D>("Backgrounds/atlantis");
            arial = Content.Load<SpriteFont>("Fonts/arial");
            arial_large = Content.Load<SpriteFont>("Fonts/arial_large");

            irparamenu = new Botao(Content, Window, "Botoes/irparamenu");
            irparamenu.posicao.X = Window.ClientBounds.Width / 2 - irparamenu.textura.Width / 2;
            irparamenu.posicao.Y = Window.ClientBounds.Height * 0.9f;

            posicaoScore.X = Window.ClientBounds.Width / 2 - arial.MeasureString(HighScore.makeHighScoreString()).X / 2;
            posicaoScore.Y = Window.ClientBounds.Height * 0.2f;
        }

        public void Update(GameTime gameTime)
        {
            irparamenu.Update(gameTime);
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(fundo, VetorZero, cor);
            irparamenu.Draw(gameTime, spriteBatch);
            spriteBatch.DrawString(arial, HighScore.makeHighScoreString(), posicaoScore, recordeCor);
        }
    }
}
